package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	httpGet01()
}

func httpGet01() {
	resp, err := http.Get("https://www.baidu.com")
	if err != nil {
		fmt.Println("GET Request error.", err.Error())
		return
	}

	defer resp.Body.Close()

	bytes, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		fmt.Println("read content error.", err.Error())
		return
	}
	content := string(bytes)
	fmt.Println("content is :", content)
}

